<template>
  <div>
    <ul class="list-group" v-if="list.length > 0">
      <li
        class="list-group-item border border-info"
        @click="onnext(item.objectId)"
        v-for="(item, index) of list"
        :key="index"
      >
        {{ item.content }}
      </li>
    </ul>
    <h1 v-else>暂无数据</h1>
    <h1>{{ msg }}</h1>
  </div>
</template>

<script>
export default {
  name: "TodoListComponent",
  // props: ["msg"],
  props: {
    msg: {
      type: String,
      required: true
    },
    listData: {
      type: Array,
      // default: []
      default: () => []
    },
    onnext: {
      type: Function,
      default: () => {}
    }
  },
  computed: {
    list() {
      return this.listData;
    }
  },
  methods: {
    // onnext() {}
  }
};
</script>

<style scoped></style>
